<?php

require_once './admin/header.php';

// Cookie中无用户信息代表用户未登录，跳转到登录界面
if($_COOKIE["userID"] == null || $_COOKIE["userName"] == null){
	echo "<script>location.href='login.php'</script>";
}
?>

<div class="container-fluid " style="background: rgba(255,255,255,0.62)">
	<nav class="navbar navbar-expand-lg navbar-light">
		<a class="navbar-brand" href="/admin#">
		</a>
		<button class="navbar-toggler"
		        type="button"
		        data-toggle="collapse"
		        data-target="#navbarSupportedContent"
		        aria-controls="navbarSupportedContent"
		        aria-expanded="false"
		        aria-label="Toggle navigation">
			<span class="navbar-toggler-icon"></span>
		</button>
		<div class="collapse navbar-collapse" id="navbarSupportedContent">
			<ul class="navbar-nav mr-auto">
				<li class="nav-item">
					<a class="nav-link" href="">首页</a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="diyIndex.php" target="adminFrame">制作贺卡</a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="myCardIndex.php" target="adminFrame">我的贺卡</a>
				</li>
			</ul>
			<div class="dropdown show dropleft">
				<a class="dropdown-toggle" href="#" role="button" id="personalCenter" data-toggle="dropdown"
				   aria-haspopup="true" aria-expanded="false">
					<?= $_COOKIE['userName'] ?>
				</a>
				<div class="dropdown-menu" aria-labelledby="personalCenter">
					<a class="dropdown-item" href="logout.php">退出登录</a>
				</div>
			</div>
		</div>

	</nav>
</div>
<!-- 左侧菜单栏 -->
<div class="container-fluid h-100">
	<div class="row h-100">
		<div class="col-12 h-100">
			<iframe src="" class="w-100 h-100" name="adminFrame" style="border: 0;"></iframe>
		</div>
	</div>
</div>

<?php require_once './admin/footer.php' ?>
